home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / geowindo / exampled.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-28  |  2.7 KB  |  111 lines

  1. // ExampleDialog.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SampleCE.h"
  6. #include "ExampleDialog.h"
  7. #include "GeometryManager.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CExampleDialog dialog
  17.  
  18.  
  19. CExampleDialog::CExampleDialog(CWnd* pParent /*=NULL*/)
  20.     : CDialog(CExampleDialog::IDD, pParent)
  21. {
  22.     //{{AFX_DATA_INIT(CExampleDialog)
  23.         // NOTE: the ClassWizard will add member initialization here
  24.     //}}AFX_DATA_INIT
  25. }
  26.  
  27.  
  28. void CExampleDialog::DoDataExchange(CDataExchange* pDX)
  29. {
  30.     CDialog::DoDataExchange(pDX);
  31.     //{{AFX_DATA_MAP(CExampleDialog)
  32.         // NOTE: the ClassWizard will add DDX and DDV calls here
  33.     //}}AFX_DATA_MAP
  34. }
  35.  
  36.  
  37. BEGIN_MESSAGE_MAP(CExampleDialog, CDialog)
  38.     //{{AFX_MSG_MAP(CExampleDialog)
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CExampleDialog message handlers
  44.  
  45. BOOL CExampleDialog::OnInitDialog() 
  46. {
  47.     CDialog::OnInitDialog();
  48.     
  49.     // initialize the geometry manager
  50.     //
  51.     HGEOM hGeom = GmStartDefinition(0);
  52.     ASSERT(hGeom);
  53.     if (hGeom)
  54.     {
  55.         // add the top-level dialog group
  56.         //
  57.         // arrange its direct children vertically
  58.         //
  59.         HGMGROUP hTopDialog = GmAddTopDialog(hGeom, m_hWnd, GM_VERTICAL);
  60.         if (hTopDialog)
  61.         {
  62.             // add the generic group for the static text and edit field
  63.             //
  64.             // arrange its direct children vertically
  65.             // give it a weight of 1
  66.             //
  67.             HGMGROUP hGroup1 = GmAddGroup(hGeom, hTopDialog, GM_VERTICAL, 1);
  68.             if (hGroup1)
  69.             {
  70.                 // add the static text group
  71.                 //
  72.                 // left-align and vertically center it
  73.                 // give it a weight of 0
  74.                 //
  75.                 GmAddWnd(hGeom, hGroup1, ::GetDlgItem(m_hWnd, IDC_SI_LABEL), GM_LEFT | GM_VCENTER, 0);
  76.                 
  77.                 // add the multiline edit field group
  78.                 //
  79.                 // allow it to grow (in both directions)
  80.                 // give it a weight of 1
  81.                 //
  82.                 GmAddWnd(hGeom, hGroup1, ::GetDlgItem(m_hWnd, IDC_SI), GM_GROW, 1);
  83.             }
  84.             
  85.             // add the generic group for the buttons
  86.             //
  87.             // right-align it
  88.             // arrange its direct children horizontally
  89.             // give it a weight of 0
  90.             //
  91.             hGroup1 = GmAddGroup(hGeom, hTopDialog, GM_RIGHT | GM_HORIZONTAL, 0);
  92.             if (hGroup1)
  93.             {
  94.                 // add the button
  95.                 //
  96.                 // don't allow any growth
  97.                 // give it a weight of 0
  98.                 //
  99.                 GmAddWnd(hGeom, hGroup1, ::GetDlgItem(m_hWnd, IDC_MORE), 0, 0);
  100.             }
  101.         }
  102.         
  103.         // end the definition and start the manager
  104.         //
  105.         GmEndDefinition(hGeom);
  106.     }
  107.  
  108.     return TRUE;  // return TRUE unless you set the focus to a control
  109.                   // EXCEPTION: OCX Property Pages should return FALSE
  110. }
  111.